Package sort
import "doc_example"
Sorting using a general interface:
Package files
sort.gofunc Float64sAreSorted
func Float64sAreSorted(a []float64) bool
func IntsAreSorted
func IntsAreSorted(a []int) bool
func IsSorted
func IsSorted(data Interface) bool
Test if data is sorted
func Sort
func Sort(data Interface)
General sort function
func SortFloat64s
func SortFloat64s(a []float64)
func SortInts
func SortInts(a []int)
Convenience wrappers for common cases
func SortStrings
func SortStrings(a []string)
func StringsAreSorted
func StringsAreSorted(a []string) bool
type Float64Array
type Float64Array []float64
func (Float64Array) Len
func (p Float64Array) Len() int
func (Float64Array) Less
func (p Float64Array) Less(i, j int) bool
func (Float64Array) Swap
func (p Float64Array) Swap(i, j int)
type IntArray
Convenience types for common cases: IntArray
type IntArray []int
func (IntArray) Len
func (p IntArray) Len() int
func (IntArray) Less
func (p IntArray) Less(i, j int) bool
func (IntArray) Swap
func (p IntArray) Swap(i, j int)
type Interface
Sorting interface
type Interface interface { Len() int Less(i, j int) bool Swap(i, j int) }
type StringArray
type StringArray []string
func (StringArray) Len
func (p StringArray) Len() int
func (StringArray) Less
func (p StringArray) Less(i, j int) bool
func (StringArray) Swap
func (p StringArray) Swap(i, j int)